﻿<%@ Page Language="C#" AutoEventWireup="true" ValidateRequest="false" CodeFile="SysSetting.aspx.cs"
    Inherits="Manager_SysSetting" %>

<%@ Register Assembly="CKEditor.NET" Namespace="CKEditor.NET" TagPrefix="CKEditor" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>系统设置</title>
    <link href="../css/main.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        .mright
        {
            margin-right: 5px;
        }
        .datecontainer .x-form-field-trigger-wrap
        {
            margin-right: 5px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <ext:PageManager ID="PageMange1" runat="server" AjaxLoadingType="mask" AutoSizePanelID="frmObject" />
    <ext:Form ID="frmObject" runat="server" Title="站点系统设置" BodyPadding="5px" LabelAlign="right"
        FooterBarAlign="center" LabelWidth="140" AutoScroll="true" ShowHeader="false">
        <Rows>
            <ext:FormRow ID="frmRow0" runat="server">
                <Items>
                    <ext:TextBox ID="txtWebName" runat="server" Label="站点名称" Required="true" EmptyText="输入站点名称"
                        ShowRedStar="true">
                    </ext:TextBox>
                    <ext:TextBox ID="txtTitle" runat="server" Label="显示标题" EmptyText="输入显示标题，即Title显示内容">
                    </ext:TextBox>
                </Items>
            </ext:FormRow>
            <ext:FormRow>
                <Items>
                    <ext:FileUpload ID="fuWebIcon" runat="server" Label="ICON显示" EmptyText="请选择显示在地址栏前的那图标，格式如 *.ico|*.png">
                    </ext:FileUpload>
                </Items>
            </ext:FormRow>
            <ext:FormRow>
                <Items>
                    <ext:FileUpload ID="fuLogo" runat="server" Label="LOGO" EmptyText="请选择网站LOGO图标，格式如 *.jpg|*.png|*.gif|*.jpeg">
                    </ext:FileUpload>
                </Items>
            </ext:FormRow>
            <ext:FormRow>
                <Items>
                    <ext:FileUpload ID="fuWeibo" runat="server" Label="微博二维码" EmptyText="官方微博二维码图标，格式如 *.ico|*.png">
                    </ext:FileUpload>
                </Items>
            </ext:FormRow>
            <ext:FormRow>
                <Items>
                    <ext:FileUpload ID="fuWeChat" runat="server" Label="微信二维码" EmptyText="官方微信二维码图标，格式如 *.ico|*.png">
                    </ext:FileUpload>
                </Items>
            </ext:FormRow>
            <ext:FormRow>
                <Items>
                    <ext:TextArea ID="txtKeywords" runat="server" Label="优化站点关键词" EmptyText="请输入优化关站点键词"
                        Height="40">
                    </ext:TextArea>
                </Items>
            </ext:FormRow>
            <ext:FormRow>
                <Items>
                    <ext:TextArea ID="txtDescription" runat="server" Label="优化站点描述" EmptyText="请输入优化站点描述"
                        Height="40">
                    </ext:TextArea>
                </Items>
            </ext:FormRow>
            <ext:FormRow>
                <Items>
                    <ext:TextBox ID="txtWebUrl" runat="server" Label="域名" EmptyText="请输入网站域名" Required="true">
                    </ext:TextBox>
                    <ext:TextBox ID="txtContactName" runat="server" Label="站点联系人" EmptyText="请输入站点联系人">
                    </ext:TextBox>
                    <ext:TextBox ID="txtEmail" runat="server" Label="电子邮件" EmptyText="请输入联系Email">
                    </ext:TextBox>
                    <ext:TextBox ID="txtWeb400" runat="server" Label="热线电话" EmptyText="请输入热线电话，如400-0000000">
                    </ext:TextBox>
                </Items>
            </ext:FormRow>
            <ext:FormRow>
                <Items>
                    <ext:TextBox ID="txtAddress" runat="server" Label="联系地址" EmptyText="请输入联系地址" Required="true"
                        ShowRedStar="true">
                    </ext:TextBox>
                </Items>
            </ext:FormRow>
            <ext:FormRow>
                <Items>
                    <ext:CheckBox ID="cboxWebStatus" runat="server" Label="站点是否启用" Text="是/否">
                    </ext:CheckBox>
                </Items>
            </ext:FormRow>
            <ext:FormRow>
                <Items>
                    <ext:CheckBox ID="cboxBaoMingState" runat="server" Label="报名是否启用" Text="是/否">
                    </ext:CheckBox>
                </Items>
            </ext:FormRow>
            <ext:FormRow>
                <Items>
                    <ext:Panel ID="Panel3" runat="server" ShowHeader="false" Layout="Column" ShowBorder="false"
                        CssClass="x-form-item datecontainer">
                        <Items>
                            <ext:Label ID="Label6" Width="100px" runat="server" Text="更新正文：">
                            </ext:Label>
                            <ext:Button ID="btnLoadData" runat="server" Text="加载数据" OnClick="btnLoadData_Click">
                            </ext:Button>
                            <ext:Label ID="Label7" runat="server" Text="（若不更新数据，则无需重新加载数据！)">
                            </ext:Label>
                        </Items>
                    </ext:Panel>
                </Items>
            </ext:FormRow>
            <ext:FormRow>
                <Items>
                    <ext:ContentPanel ID="ContentPanel1" runat="server" AutoWidth="true" ShowBorder="false"
                        ShowHeader="false">
                        <table cellpadding="0" cellspacing="0" style="width: 100%;">
                            <tr>
                                <td valign="top" style="width: 140px; text-align: right;">
                                    站点关闭提示：
                                </td>
                                <td style="padding-right: 22px;">
                                    <textarea name="UEditor1" id="UEditor1"></textarea>
                                </td>
                            </tr>
                        </table>
                    </ext:ContentPanel>
                </Items>
            </ext:FormRow>
            <ext:FormRow>
                <Items>
                    <ext:ContentPanel ID="ContentPanel2" runat="server" AutoWidth="true" ShowBorder="false"
                        ShowHeader="false">
                        <table cellpadding="0" cellspacing="0" style="width: 100%;">
                            <tr>
                                <td valign="top" style="width: 140px; text-align: right;">
                                    站点底部信息：
                                </td>
                                <td style="padding-right: 22px;">
                                    <textarea name="UEditor2" id="UEditor2"></textarea>
                                </td>
                            </tr>
                        </table>
                    </ext:ContentPanel>
                </Items>
            </ext:FormRow>
        </Rows>
        <Toolbars>
            <ext:Toolbar ID="Toolbar1" runat="server" Position="top">
                <Items>
                    <ext:ToolbarText ID="ToolbarText1" runat="server" Text="站点系统设置 ">
                    </ext:ToolbarText>
                </Items>
            </ext:Toolbar>
        </Toolbars>
        <Toolbars>
            <ext:Toolbar ID="tbButton" runat="server" Position="footer">
                <Items>
                    <ext:Button ID="btnSubmit" runat="server" Text="信息保存" Icon="systemsave" ValidateForms="frmObject"
                        OnClick="btnSubmit_Click">
                    </ext:Button>
                    <ext:Button ID="btnReset" runat="server" Text="重 置" Icon="reload">
                    </ext:Button>
                </Items>
            </ext:Toolbar>
        </Toolbars>
    </ext:Form>
    </form>

    <script type="text/javascript">
        window.UEDITOR_HOME_URL  = '<%= ResolveUrl("~/ueditor/") %>';
    </script>

    <script type="text/javascript" src="../ueditor/editor_config.js"></script>

    <script type="text/javascript" src="../ueditor/editor_all.js"></script>

    <script type="text/javascript">
        var editor1,editor2;
        function onReady() {
            editor1 = new UE.ui.Editor({
                initialFrameWidth: '100%',
                initialFrameHeight: 350,
                minFrameHeight: 350,
                autoFloatEnabled: false,
                focus: true
            });
            editor1.render("UEditor1");
            
            editor2 = new UE.ui.Editor({
                initialFrameWidth: '100%',
                initialFrameHeight: 80,
                minFrameHeight: 80,
                autoFloatEnabled: false,
                initialContent: '',
                toolbars: [
                ['fullscreen', 'source', '|', 'undo', 'redo', '|',
                    'bold', 'italic', 'underline', 'strikethrough', 'superscript', 'subscript',
                    'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain']]
            });
            editor2.render("UEditor2");

        }


        // 提交数据之前同步到表单隐藏字段
        X.util.beforeAjaxPostBackScript = function () {
            editor1.sync();
            editor2.sync();
        };


        // 更新编辑器内容
        function updateUEditor1(content) {
            window.setTimeout(function () {
                editor1.setContent(content);
            }, 100);
        }

        function updateUEditor2(content) {
            window.setTimeout(function () {
                editor2.setContent(content);
            }, 100);
        }    
    </script>

</body>
</html>
